package com.jd.security.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;

@RestController
public class ErrorCtr {
    private static final Logger log = LoggerFactory.getLogger(ErrorCtr.class);

    @GetMapping("/authorities/resources")
    public String getAuthoritiesResources(String path) {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        System.out.println(JSON.toJSONString(authentication));
        return "授权成功";
    }


}
